home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE4
/
POWERBASE
/
DOCS
/
Ch14-Cust
< prev
next >
Wrap
Text File
|
2001-02-02
|
23KB
|
440 lines
=============================
Ch 14 − Customising Powerbase
=============================
This chapter describes all the things you can do to influence the way
Powerbase looks and functions.
14.1 Overall control of the database
---------------------------------------
A Powerbase database is normally controlled in four ways:
• mouse-clicks on the keypad
• keystrokes which mimic the actions of the keypad
• choices from the main menu
• choices from the iconbar menu
Each of these can be disabled by deselecting one of the option switches on
the Password window (see 11.2). The main reason why you might want to do
this is to provide limited facilities to someone else who is using your
database. It doesn’t, on the face of it, make a lot of sense to disable
both the keypad and the keystroke-equivalents as no browsing or editing
would then appear to be possible. You can, however, place some or all of the
keypad buttons on the record window itself (see 4.2.8) thus allowing you to
choose what functions you want to allow access to. You might, for example,
wish to provide only the “Next record”, “Previous record” and “Search”
buttons. Define these as Button fields at the time the record is being
designed then disable the keypad and keystroke equivalents. Other switches
in the Password window enable you to stop the user printing reports or
exporting data as CSV files or subsets.
14.2 Defining the function keys
----------------------------------
Any button on the keypad may have its action duplicated by one of the keys
F1-F11, with or without the use of Shift or Ctrl. Point at the button to
which you wish to assign a key and click MENU to display the keypad menu.
Assign leads to a window which shows the present key-assignment, if any. Use
the “bump” icons to select the required function key and, if desired, select
one of the switches for Shift and Ctrl. Click on the Assign button and you
will now find that the assigned key exactly mimics the keypad button − even
to the extent of actually “pressing” the button when you type the key.
One important constraint should be noted. Whatever key you assign to
the Search button, Powerbase will automatically assign the shifted version
of this key to the “search all subfiles” function (see 2.3.1). For this
reason you should assign an unshifted key to Find and avoid assigning the
shifted version to any other keypad button. Similarly, assigning a key to
the Add record button automatically assigns the shifted key to the Copy
record function.
You may save your key definitions by choosing Save choices from the
keypad menu and you will find them operative next time you use Powerbase.
Note that your definitions work with all the databases you use; there is no
facility for saving separate assignments for each database. The default
keystrokes (together with some which duplicate non-keypad actions) are
listed in Appendix B. If they have been redefined you may restore the
defaults by choosing Defaults from the keypad menu. If you wish to “lose”
the redefined keystrokes permanently you should restore the defaults as
described then Save choices.
List keys on the keypad menu displays all the key definitions
(including those for non-keypad functions) in a window from which the
information may be saved as a text file.
Function keys may also be used to enter data into record fields or
writable icons in dialogue boxes. The actual programming of the keys is
done at the command line which is accessed by pressing f12. This takes you
temporarily out of the desktop and gives you a “star” prompt at the bottom
of the screen. Suppose you want to program f3 to enter the word
“Powerbase”. Type, at the star prompt:
Key3 Powerbase
and press Return twice to return to the desktop. The string assigned to the
key may be entered by typing Ctrl Shift F3. Any of the keys F1-F9 may be
programmed and the string is always entered by typing the key with Ctrl and
Shift both held down.
14.3 CSV options
-------------------
It was explained in 8.2 how to access the CSV options window and what the
pop-up menus and option switches are for. The buttons Save choices, as
default, in database, Load default and Cancel work in a similar way to that
described above for the Print options window − with one notable difference.
- 58 -
No Save box appears when you Save choices in database; the file is saved as
a plain text file called CSVoptions. This more limited behaviour has been
chosen because, although you might want several Print options files for
different jobs, it is unlikely that you will have a use for several CSV
options files.
14.4 Preferences
-------------------
Several previous references have been made to the Preferences window which
is opened from the iconbar menu. A full description of the choices offered
in this window follows.
14.4.1 Separators in date and time fields
By default Date fields have the format dd-mm-yy or dd-mm-yyyy, i.e. they use
a hyphen as a separator. Time fields have the form hh:mm:ss, i.e the
separator is a colon. These defaults may be changed by entering your
preferred separators in the two writable icons in the Separators section at
the top of the Preferences window and clicking Accept.
Note that when entering dates or times into these field types you
may actually type any non-numeric character you wish as a separator. On
moving to another field Powerbase will re-format the date or time to use the
separator specified in Preferences.
14.4.2 Wild-cards
The use of wild-card characters is described in 2.5.5 and 3.5.3. By default
“#” represents a single character and “$” a group of characters which need
not be matched. You may change either or both wild-card characters if you
wish in the same way as described above for date and time separators.
14.4.3 Option switches
Record edits as CSV file when ON causes a CSV file called NewData to be
created in PrintJobs. New and edited records are saved in this file which
may then be used to enter data into another database.
Launch new copy when ON causes another copy of Powerbase to be loaded when
you double-click on a database, instead of closing the current database.
This can be useful if you want to access several databases at once, as one
copy of Powerbase only supports the use of a single database. If there is a
dormant copy of Powerbase on the iconbar (i.e. one with “No data” under its
icon) then double-clicking a database sends it to that copy rather than
launching a new one. With the switch OFF double-clicking on a database
closes down an already-open database before opening the new one. Even then
you can load multiple copies of Powerbase by double-clicking on Powerbase
itself and then open a different database in each by dragging the databases
to the icons.
Case-sensitive queries. You can choose the default state of the corresponding
switch on the Query panel by setting this switch as required and saving the
Preferences.
Recalculate on opening affects Computed fields (see 6.1 and 6.2) whose
associated formulae make use of the system variable TIME$ and also Stamp
fields for which Update to now is set in the Field Definition window (see
4.2.10). With the switch OFF the contents of such fields are recalculated
only when a record is displayed. This might not be good enough where, for
example, TIME$ is used in a User function (see 6.3) to keep track of
people’s current ages. Selecting the switch causes Powerbase to scan the
whole file and update such fields when the database is first opened.
Blank record on deletion. If this switch is OFF then deleting a record from
the database merely removes all references to its key(s) from the index(es),
leaving the actual record data untouched in the Database file. Although such
“deleted” records will be overwritten when new records are entered, the
situation may be deemed unsatisfactory from a security point of view since
the “deleted” records can be examined by simply loading Database into Edit.
If the switch is ON deletion causes the relevant record to be over-written
with a blank record.
Keep descriptor with data alters the behaviour of fields as they are dragged
around the screen when designing the record layout. With the switch OFF you
may drag the data field and the descriptor independently of one another.
With the switch ON this is true only of the descriptor; if you drag the data
field the descriptor jumps to its “normal” position to the left of the data
field as soon as you release the mouse button.
Validate input turns data validation (see Ch 5) ON and OFF. If you ever
find yourself unable to escape from a field linked to a validation table you
can bring up the Preferences window, deselect this switch and try again.
Shift-F9 also will toggle validation ON and OFF. If the keypad is visible
- 59 -
you will see the List values button become shaded when validation is
disabled.
Display linked table data. Every time the caret enters a field with a link to
a validation table a window showing data from the relevant validation table
row appears to the right of the field if the switch is ON. This is either
useful or infuriating, depending on your point of view. If turned OFF you
can still call up the window for a specific field by double-clicking on the
field with SELECT (see 5.5).
Warn of external deletion. Since deleting data from an External field (see
2.6.3) involves the deletion of an actual file you will probably appreciate
being warned when you are about to do it. With this switch ON you will be
given a warning and the opportunity to change your mind.
Warn of duplicates. The creation of records with identical primary keys can
be prohibited if so desired (see 11.2.1). Normally, however, they are
permitted. You may, if you wish, turn this switch ON to issue a warning that
such a record is about to be created.
Default action on Return. According to the Style Guide for RISC OS typing
Return anywhere inside a dialogue box ought to have the same effect as
clicking on the default action button (that’s the one with the yellow
channel border) regardless of which writable icon the caret is in. If that’s
what you want then turn this switch ON. Many users (including the author!)
hate it and prefer the default action to take place only if the caret is in
the last writable icon when Return is typed. Hence the default setting,
which is OFF.
Strip leading spaces is ON by default. Spaces at the beginning of data
fields will be stripped before the record is written to the file. Turn the
switch OFF if you actually want spaces in this position
Strip trailing spaces should normally be left ON to avoid unwanted spaces at
the right of data fields. It is easy to press the space-bar by accident when
entering data quickly and you might not notice that a field has one or more
spaces between the end of the last word and the caret.
Balance every <n> records. The need to balance indices and the use of this
option is explained in 10.6.
Remember place in subfile. With this switch OFF a change of subfile leads to
the display of the first record in the new subfile. If you are doing a lot
of hopping back and forth between subfiles to inspect specific records you
might want to select the switch. It is then just as if you had bookmarks in
separate chapters of a book; when you return to a subfile you have
previously visited you will see the same record you were viewing when you
left that subfile.
14.4.4 Save indices (Default: Manual)
Indices are always saved whenever you close a database or quit Powerbase and
only fear of power cuts or system failure (which includes some kind person
switching off your computer!) need make you concerned about saving them
yourself. With the Manual setting nothing happens during normal working
unless you click Force update on the keypad. Selecting Automatic or Warn
only allows you to type in a suitable time interval (default = 10 min) at
which Powerbase will either issue a warning to save your indices (using
Force update) or actually save them for you.
14.4.5 Start editing at
When a record is displayed the caret is placed, by default, in the first
editable field. Editing may be made to start at a different field by
choosing Start editing from the Field submenu (see 2.5.4) or, alternatively,
by placing the caret in the required field and typing Ctrl S. The tag of
the relevant field is stored in this writable icon in the Preferences window
and can be saved along with the other preferences.
14.4.6 Application for ImpulseII data-merging
As noted elsewhere (9.2) Powerbase can merge directly into a
suitably-formatted Impression document by simply dropping the document icon
onto the record window. The dialogue box which then appears contains a
writable icon which shows the application with which Powerbase will merge.
This name is, by default, “Impression”, but may be altered by users for
their own purposes. An application which will receive data from Powerbase in
this way must make use of the ImpulseII protocols as defined by Computer
Concepts. Even if you are using Style or Publisher the name to which these
applications respond is still “Impression”.
14.4.7 Save choices
This section of the window works exactly as it does for CSV options (see
14.4) as do the Load default and Cancel buttons.
- 60 -
14.5 Colours of key fields and table-linked fields
-----------------------------------------------------
These may be selected in a window reached by choosing Colours from the
Miscellaneous submenu. The following default colours are used:
Type Foreground Background
---- ---------- ----------
Descriptor of key field (inactive) dark blue light grey
Descriptor of key field (active) red light grey
Data icon of primary key field(s) black pale yellow
Data icon of field linked to validation table dark green white
Data icon of mandatory field red white
Clicking with SELECT on the descriptor and data icons within this window
makes either the foreground or background (depending on the setting of the
two radio buttons) cycle through the available colours. Clicking with ADJUST
cycles through the colours in the opposite direction.
The effect of the changes can be seen immediately and Save choices allows
you to save them in the database as a file called Colours. Different
databases can have different colours. Defaults enables you to return the
colours to what they were before by loading Powerbase’s own Colours file,
but you can overwrite this too if you wish by selecting in Powerbase before
clicking Save choices. The Close button merely closes the window.
14.6 Config files
--------------------
Inside the Powerbase application directory is a sub-directory called
Resources. The file Config, which will be found there, determines certain
aspects of the program’s operation which will seldom need changing. Changes
made to Config take effect only when Powerbase is next loaded. Each
attribute is identified by a token word and there is a comment line
describing each. The attributes in Config are as follows:
Fields Maximum number of fields per record (default=100, maximum=127)
Keys Maximum number of subsidiary indices (default = 10)
Tabs Maximum number of validation tables (default = 10)
Cols Maximum number of columns in a validation table (default = 20)
Scrolls Maximum number of scrollable lists (default=5)
BTime Number of seconds for which start-up banner (for a registered
copy) is displayed (default = 2)
LeftOpen Whether submenus off the iconbar menu open on the left instead of
on the right as normal. This avoids the overlapping submenus
which can occur but many users hate it! (Default: NO)
BackGnd Background colour of record window. Default=1 (pale grey).
Upper Whether password entry is forced to uppercase. (Default: NO)
DirOpts Display option for directories opened by buttons on the record
window. Default is -si (small icons). This may be changed to -li
or -fi (large icons and full information respectively). The
options to sort by name, type, date and size (-sn, -st, -sd, -ss)
may also be added after a space.
ExtFiles (default=NEW) Method used for storing Text, Sprite and Draw files
which are linked to External fields. You should normally leave
this set at the default (NEW). A description of the old and new
methods is given below (14.6.1).
Query Default query method. Default: SF (Search Formula), alternative:
QBE (Query-By-Example).
PathLen Maximum pathlength for Remote filer objects (default 255; max.
prior to RISC OS 4)
FontAdj Whether width of data fields takes account of desktop font
(default: YES)
Multi Whether Powerbase multi-tasks when printing lists, indexing etc.
(default: NO)
Markpane Whether pane for marking records for printing etc. appears
attached to record window. (default: YES).
NameLen Maximum filename (i.e. leafname) length (default: 10). If you
regularly use something like LongFiles or raFS, or if you have
RISC OS 4, you might want to increase this value but beware if
you give someone one of your databases containing saved files
with names longer than 10 characters!
ButtonAtts Attributes of Directory and Run file buttons when used on record
window (see 4.2.11). The default (42) is the width in pixels (not
- 61 -
OS units). The sprite will be vertically, as well as
horizontally, centred on the button unless you add L to the
number. If you do so then the leafname of the attached file or
directory will appear on the button underneath the sprite. You
will probably need to make the button much wider to accommodate
the leafname.
DialDelay Double-clicking with SELECT on a field containing a phone number
whose tag or descriptor contains the string TEL (case
insensitive) will attempt to produce dial-tones through the
internal speaker. If you hold a telephone handset where it can
“hear” the tones the number will be dialled. This Config option
allows you to specify the delay in second between the
double-click and the tones. (Default=5)
TimeFirst determines the interpretation of incomplete entries in Time
fields (see 4.2.5) Default=H (hours first), alternative=S
(seconds first)
FullTime Either always display as hh:mm:ss (default=YES) or allow mm:ss
for times under 1 hour (NO)
Output If 1 (default) send output for Printer destination directly to
printer. If 2 write first to file, then copy to printer. The
latter may be needed to overcome problems with certain
combinations of hardware and versions of !Printers.
Individual databases may be provided with their own Config files but Fields,
Keys, Tabs, Cols, BTime and LeftOpen may only be set in Powerbase’s own
Config file and will affect all databases. BackGnd may be set for an
individual database but will affect only the background colours of field
descriptors, not the window colour itself. Where choices are valid they
override Powerbase’s own settings.
14.6.1 Pathnames for External file objects
The OLD method of deriving the pathname for the stored file object is as
follows:
(a) Divide the record number by 4900. The integer part of the result is
used as the name of the top-level directory.
(b) Divide the record number by 70. The integer part of the result is
used as the name of the second-level directory.
(c) The integer remainder of dividing the record number by 70 is used as
the actual filename.
This is an awkward system if you are in the habit of using the filer windows
to sift through the files rather than relying on Powerbase to display them.
To calculate the number of the record to which the file belongs you have to
take the number forming the name of the file’s parent directory, multiply by
70 and add the number corresponding to the filename itself.
The new system improves on this. Steps (a) and (b) are identical. The
filename itself, however, uses the whole record number preceded by Rec, e.g.
a file associated with record 275 will be called Rec275. You can therefore
use the RISC OS filer’s Find command to locate and examine the file. Under
the OLD system such a file would be called 65.
The default setting in Config is NEW. Users should be aware that the
earliest version of Powerbase to support this feature is v. 6.94, dated
02-03-96. This and later versions understand both methods of storage and
will rename files according to the Config setting when a record is
displayed. Thus, a database created under an earlier version in which record
275 is represented by a file called 65 will have that file renamed to Rec275
simply by displaying the record, even if the file itself is not loaded.
Once this has happened the file cannot be found by an earlier version of
Powerbase. Under most circumstances this should not cause any difficulty;
just make sure you are using v. 6.94 or later. Should you wish to run a
database under an earlier version and access the External file objects from
the record window you must first convert the filenames to the OLD format.
To do so place OLD in the Config file as described above, then load
Powerbase. Open your database and click on the Play button. Click on Stop
when all records have been displayed. If you use more than one subfile you
will need to do this for each occupied subfile. OLD may be converted to NEW
pathnames in a similar way.
14.7 The Messages file
-------------------------
This text file in the Resources sub-directory contains all the error and
warning messages used by Powerbase including those for Acorn’s interactive
Help application. The wording may be altered if you wish. Many error
messages contain the string “%0” and possibly “%1” and “%2”. Data items are
substituted for these when the message is printed so don’t omit them or
alter their logical placement within the message.
- 62 -